{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "6d6b5cae-d4e0-4c87-99c5-7757d3eab47a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl\n",
    "from perspective.widget import PerspectiveWidget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "54ac9f6a-32e7-4801-8127-41eb045a0ddb",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = pl.read_parquet(\"new_share.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "db373c0b-97c7-4832-a471-50c3ca45a7c7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2000, 12)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d1.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "44ac95b1-9289-4b3e-af97-57a0c1fb78eb",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = pl.read_parquet(\"stock_basic.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "79207482-bf31-4fe2-a134-6ddcca0dda36",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(5412, 17)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d2.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "c29293ee-a322-4c6a-a331-200c9f602675",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    ipo_date=pl.col.ipo_date.str.to_date(\"%Y%m%d\"),\n",
    "    issue_date=pl.col.issue_date.str.to_date(\"%Y%m%d\"),\n",
    ")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "b16ad3d5-c920-4220-a1a8-e9fc59e58fa3",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.with_columns(\n",
    "    list_date=pl.col.list_date.str.to_date(\"%Y%m%d\"),\n",
    ")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "8a422cfc-23cd-4b98-8332-7e3a192ffdb3",
   "metadata": {},
   "outputs": [],
   "source": [
    "config = '{\"version\":\"3.5.1\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"pe\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"USD\"}},\"name\":{\"string_color_mode\":\"series\",\"color\":\"#3d27aa\"},\"amount\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"USD\"}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"price\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "d54fa406-f621-4a85-9f48-787ffa0fe36d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"version\":\"3.5.1\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"pe\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"USD\"}},\"name\":{\"string_color_mode\":\"series\",\"color\":\"#3d27aa\"},\"amount\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"USD\"}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"price\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}\n"
     ]
    }
   ],
   "source": [
    "print(config)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "4463ff9a-3e44-4c36-bd17-abb0ce182c63",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "c3df14f3-f906-44c0-92a3-ae6395084518",
   "metadata": {},
   "outputs": [],
   "source": [
    "config2 = Path(\"C:/Users/刘佳骏/Downloads/untitled.config.json\").read_text()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "26260c0f-16d5-4d5d-a2b8-be42fba4f70b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"version\":\"3.5.1\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"pe\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"USD\"}},\"name\":{\"string_color_mode\":\"series\",\"color\":\"#3d27aa\"},\"amount\":{\"number_format\":{\"style\":\"currency\",\"currency\":\"USD\"}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"price\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}\n"
     ]
    }
   ],
   "source": [
    "print(config2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "083d5283-7925-4a0c-98a7-0ae14c966c3d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "config == config2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "8f4f6600-f3a7-4d0e-b6fe-9d0c7274e529",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "3c2502ea-ef43-41f1-ab60-593fbe550bff",
   "metadata": {},
   "outputs": [],
   "source": [
    "b = json.loads(config)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "002a0bf0-9c85-4cdb-932a-054b270a22b7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'version': '3.5.1',\n",
       " 'plugin': 'Datagrid',\n",
       " 'plugin_config': {'columns': {},\n",
       "  'edit_mode': 'READ_ONLY',\n",
       "  'scroll_lock': False},\n",
       " 'columns_config': {'pe': {'number_format': {'style': 'currency',\n",
       "    'currency': 'USD'}},\n",
       "  'name': {'string_color_mode': 'series', 'color': '#3d27aa'},\n",
       "  'amount': {'number_format': {'style': 'currency', 'currency': 'USD'}}},\n",
       " 'settings': True,\n",
       " 'theme': 'Pro Light',\n",
       " 'title': None,\n",
       " 'group_by': [],\n",
       " 'split_by': [],\n",
       " 'sort': [],\n",
       " 'filter': [],\n",
       " 'expressions': {},\n",
       " 'columns': ['ts_code',\n",
       "  'sub_code',\n",
       "  'name',\n",
       "  'ipo_date',\n",
       "  'issue_date',\n",
       "  'amount',\n",
       "  'market_amount',\n",
       "  'price',\n",
       "  'pe',\n",
       "  'limit_amount',\n",
       "  'funds',\n",
       "  'ballot'],\n",
       " 'aggregates': {}}"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "0ad1084b-9e39-4113-a85f-bec4d5449f26",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "1f075d84-2df3-47f6-ada6-50524596409f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['version', 'plugin', 'plugin_config', 'columns_config', 'settings', 'theme', 'title', 'group_by', 'split_by', 'sort', 'filter', 'expressions', 'columns', 'aggregates'])"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "11529e80-1d88-4142-8cf0-65e4618bc1b3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "9cd22cad-fba0-4d26-bd61-07013ea1f413",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "107717f9632f46589122c317f2d570b3",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "2f3d3d5a-2d07-4eb0-9d3a-f8973d9b8733",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8b321b0536e5439f87b12637152e0e91",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'symbol', 'name', 'area', 'industry', 'fullname',…"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "eb1d35c2-9050-4c96-a278-9ec5ac69183c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2_000, 28)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>sub_code</th><th>name</th><th>ipo_date</th><th>issue_date</th><th>amount</th><th>market_amount</th><th>price</th><th>pe</th><th>limit_amount</th><th>funds</th><th>ballot</th><th>symbol</th><th>name_right</th><th>area</th><th>industry</th><th>fullname</th><th>enname</th><th>cnspell</th><th>market</th><th>exchange</th><th>curr_type</th><th>list_status</th><th>list_date</th><th>delist_date</th><th>is_hs</th><th>act_name</th><th>act_ent_type</th></tr><tr><td>str</td><td>str</td><td>str</td><td>date</td><td>date</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>date</td><td>null</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;301636.SZ&quot;</td><td>&quot;301636&quot;</td><td>&quot;泽润新能&quot;</td><td>2025-04-28</td><td>null</td><td>1597.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.45</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;001400.SZ&quot;</td><td>&quot;001400&quot;</td><td>&quot;江顺科技&quot;</td><td>2025-04-15</td><td>2025-04-24</td><td>1500.0</td><td>1500.0</td><td>37.36</td><td>15.32</td><td>1.5</td><td>5.604</td><td>0.01</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301560.SZ&quot;</td><td>&quot;301560&quot;</td><td>&quot;众捷汽车&quot;</td><td>2025-04-15</td><td>null</td><td>3040.0</td><td>1216.0</td><td>16.5</td><td>21.3</td><td>0.7</td><td>5.016</td><td>0.02</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;603202.SH&quot;</td><td>&quot;732202&quot;</td><td>&quot;天有为&quot;</td><td>2025-04-14</td><td>2025-04-24</td><td>4000.0</td><td>2611.0</td><td>93.5</td><td>13.5</td><td>1.25</td><td>37.4</td><td>0.03</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301662.SZ&quot;</td><td>&quot;301662&quot;</td><td>&quot;宏工科技&quot;</td><td>2025-04-08</td><td>2025-04-17</td><td>2000.0</td><td>813.0</td><td>26.6</td><td>7.05</td><td>0.45</td><td>5.32</td><td>0.02</td><td>&quot;301662&quot;</td><td>&quot;C宏工&quot;</td><td>&quot;广东&quot;</td><td>&quot;专用机械&quot;</td><td>&quot;宏工科技股份有限公司&quot;</td><td>&quot;Ongoal Technology Co.,Ltd.&quot;</td><td>&quot;hgkj&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2025-04-17</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;002953.SZ&quot;</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>2019-04-24</td><td>2019-05-09</td><td>4302.0</td><td>3872.0</td><td>10.52</td><td>16.34</td><td>1.7</td><td>4.526</td><td>0.03</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>&quot;广东&quot;</td><td>&quot;电气设备&quot;</td><td>&quot;广东日丰电缆股份有限公司&quot;</td><td>&quot;Guangdong Rifeng Electric Cabl…</td><td>&quot;rfgf&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-09</td><td>null</td><td>&quot;N&quot;</td><td>&quot;冯就景&quot;</td><td>&quot;民营企业&quot;</td></tr><tr><td>&quot;603697.SH&quot;</td><td>&quot;732697&quot;</td><td>&quot;有友食品&quot;</td><td>2019-04-23</td><td>2019-05-08</td><td>7950.0</td><td>7155.0</td><td>7.87</td><td>13.92</td><td>3.1</td><td>6.257</td><td>0.05</td><td>&quot;603697&quot;</td><td>&quot;有友食品&quot;</td><td>&quot;重庆&quot;</td><td>&quot;食品&quot;</td><td>&quot;有友食品股份有限公司&quot;</td><td>&quot;Youyou Foods Co.,Ltd.&quot;</td><td>&quot;yysp&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-08</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;300772.SZ&quot;</td><td>&quot;300772&quot;</td><td>&quot;运达股份&quot;</td><td>2019-04-17</td><td>2019-04-26</td><td>7349.0</td><td>6614.0</td><td>6.52</td><td>22.97</td><td>2.8</td><td>4.792</td><td>0.04</td><td>&quot;300772&quot;</td><td>&quot;运达股份&quot;</td><td>&quot;浙江&quot;</td><td>&quot;电气设备&quot;</td><td>&quot;运达能源科技集团股份有限公司&quot;</td><td>&quot;Windey Energy Technology Group…</td><td>&quot;ydgf&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-04-26</td><td>null</td><td>&quot;S&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;603967.SH&quot;</td><td>&quot;732967&quot;</td><td>&quot;中创物流&quot;</td><td>2019-04-17</td><td>2019-04-29</td><td>6667.0</td><td>6000.0</td><td>15.32</td><td>22.24</td><td>2.6</td><td>10.213</td><td>0.04</td><td>&quot;603967&quot;</td><td>&quot;中创物流&quot;</td><td>&quot;山东&quot;</td><td>&quot;仓储物流&quot;</td><td>&quot;中创物流股份有限公司&quot;</td><td>&quot;China Master Logistics Co., Lt…</td><td>&quot;zcwl&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-04-29</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;300773.SZ&quot;</td><td>&quot;300773&quot;</td><td>&quot;拉卡拉&quot;</td><td>2019-04-16</td><td>2019-04-25</td><td>4001.0</td><td>3601.0</td><td>33.28</td><td>22.99</td><td>1.2</td><td>13.315</td><td>0.04</td><td>&quot;300773&quot;</td><td>&quot;拉卡拉&quot;</td><td>&quot;北京&quot;</td><td>&quot;软件服务&quot;</td><td>&quot;拉卡拉支付股份有限公司&quot;</td><td>&quot;Lakala Payment Co., Ltd.&quot;</td><td>&quot;lkl&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-04-25</td><td>null</td><td>&quot;S&quot;</td><td>null</td><td>null</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2_000, 28)\n",
       "┌───────────┬──────────┬──────────┬────────────┬───┬─────────────┬───────┬──────────┬──────────────┐\n",
       "│ ts_code   ┆ sub_code ┆ name     ┆ ipo_date   ┆ … ┆ delist_date ┆ is_hs ┆ act_name ┆ act_ent_type │\n",
       "│ ---       ┆ ---      ┆ ---      ┆ ---        ┆   ┆ ---         ┆ ---   ┆ ---      ┆ ---          │\n",
       "│ str       ┆ str      ┆ str      ┆ date       ┆   ┆ null        ┆ str   ┆ str      ┆ str          │\n",
       "╞═══════════╪══════════╪══════════╪════════════╪═══╪═════════════╪═══════╪══════════╪══════════════╡\n",
       "│ 301636.SZ ┆ 301636   ┆ 泽润新能 ┆ 2025-04-28 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 001400.SZ ┆ 001400   ┆ 江顺科技 ┆ 2025-04-15 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 301560.SZ ┆ 301560   ┆ 众捷汽车 ┆ 2025-04-15 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 603202.SH ┆ 732202   ┆ 天有为   ┆ 2025-04-14 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 301662.SZ ┆ 301662   ┆ 宏工科技 ┆ 2025-04-08 ┆ … ┆ null        ┆ N     ┆ null     ┆ null         │\n",
       "│ …         ┆ …        ┆ …        ┆ …          ┆ … ┆ …           ┆ …     ┆ …        ┆ …            │\n",
       "│ 002953.SZ ┆ 002953   ┆ 日丰股份 ┆ 2019-04-24 ┆ … ┆ null        ┆ N     ┆ 冯就景   ┆ 民营企业     │\n",
       "│ 603697.SH ┆ 732697   ┆ 有友食品 ┆ 2019-04-23 ┆ … ┆ null        ┆ N     ┆ null     ┆ null         │\n",
       "│ 300772.SZ ┆ 300772   ┆ 运达股份 ┆ 2019-04-17 ┆ … ┆ null        ┆ S     ┆ null     ┆ null         │\n",
       "│ 603967.SH ┆ 732967   ┆ 中创物流 ┆ 2019-04-17 ┆ … ┆ null        ┆ N     ┆ null     ┆ null         │\n",
       "│ 300773.SZ ┆ 300773   ┆ 拉卡拉   ┆ 2019-04-16 ┆ … ┆ null        ┆ S     ┆ null     ┆ null         │\n",
       "└───────────┴──────────┴──────────┴────────────┴───┴─────────────┴───────┴──────────┴──────────────┘"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = d1.join(d2,on=\"ts_code\",how=\"left\")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "13ee7a8e-252f-4a46-a9c6-43ead4ff412d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8a3a2b75ac7b4dd3aab4ffdab2375e90",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "5525b449-5fa2-465f-bf94-7f61267c3600",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b8ecc32e25974d02b056d96c8c1102f4",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "9cbb02db-e838-4839-b51e-e61d9a3d208e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "aa739be9f07148bd9003f4d78689382d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'symbol', 'name', 'area', 'industry', 'fullname',…"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "3550f78b-d250-4a32-9925-a17a46fee690",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b16f446ae678406a8c303741b601e57e",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "e5d5f1dd-3c9b-4bcc-b9f4-b508efcbdddd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "dd4e131b79cf4b988a07ba5e5f199962",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "0c3d7175-b08d-47b0-aa45-c1da2615c405",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "242f5a519ed34febb5c622231e0b8fff",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "0d601e84-49a6-45b5-ba7f-7419a80eb609",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "de76b8f5f11b465992463ddfe81516de",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "21de2cf3-cf9c-4e65-9e53-5ae986ddc0da",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
